<template>
  <div class="box">
    抱歉，找不到对应页面<br />
    {{ num }}秒后跳转
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: 5,
      timeID: 'a'
    }
  },
  created() {
    this.timeId = setInterval(() => {
      this.num--
      if (this.num === 0) this.$router.push('/')
    }, 1000)
  },
  destroyed() {
    clearInterval(this.timeId)
  }
}
</script>

<style lang="less" scoped>
.box {
  font-size: 24px;
}
</style>
